package logger

import "strings"

type Level uint16

const (
	Debug Level = iota
	Info
	Warning
	Error
	Fatal
)

func getLevel(level Level) string {
	switch level {
	case Debug:
		return "DEBUG"
	case Info:
		return "INFO"
	case Warning:
		return "WARNING"
	case Error:
		return "ERROR"
	case Fatal:
		return "FATAL"
	default:
		return "DEBUG"
	}
}

func ParseLogLevel(level string) Level {
	level = strings.ToUpper(level)
	switch level {
	case "DEBUG":
		return Debug
	case "INFO":
		return Info
	case "WARNING":
		return Warning
	case "ERROR":
		return Error
	case "FATAL":
		return Fatal
	default:
		return Debug
	}
}
